1 /****************************** Module Header ******************************\
2 Module Name: OrphanedCS.h
3 Project: CppApplicationHang
4 Copyright (c) Microsoft Corporation.
6 Examination of the critical section in question leads to a thread ID that
7 does not exist. This is referred to as an orphaned critical section.
9 Here, we demonstrate two typical scenarios of orphaned critical section:
11 Orphaned Critical Section Scenario 1:
12 An exception filter catches an exception during execution of code
13 (typically it is some third party code written for RPC or COM server) that
14 is holding a critical section.
16 Orphaned Critical Section Scenraio 2:
17 The main thread calls TerminateThread to terminate a thread that owns a
20 This source is subject to the Microsoft Public License.
21 See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
22 All other rights reserved.
24 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
25 EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
26 WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
27 \***************************************************************************/
32 void TriggerOrphanedCS1();
35 void TriggerOrphanedCS2();